package com.bbf.springmvcdemo.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;

import javax.servlet.ServletContext;

/**
 * 自定义Web上下文监听
 * @author BBF
 */
public final class WebContextListener extends ContextLoaderListener {
  private static final Logger LOGGER = LoggerFactory.getLogger(WebContextListener.class);

  @Override
  public WebApplicationContext initWebApplicationContext(ServletContext servletContext) {
    LOGGER.info("\r\n======================================================================" +
        "\r\n\r\n    " +
        "欢迎使用,  - Powered By bbf." +
        "\r\n\r\n======================================================================\r\n");
    return super.initWebApplicationContext(servletContext);
  }
}